From ddd245496797aa54ca5f282353a6b043bb45a399 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 6 Nov 2015 16:10:05 -0800 Subject: [PATCH] Make Swift iterators throw errors on failure This is in line with FSFileBackend and is provides the calling loop of a way to know the listing failed, rather than just giving incomplete information. Change-Id: I34c66d9dbf84e5f33982d17e61364c1595d3e9f7 --- includes/filebackend/SwiftFileBackend.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/filebackend/SwiftFileBackend.php b/includes/filebackend/SwiftFileBackend.php index 8097549508..72a877d072 100644 --- a/includes/filebackend/SwiftFileBackend.php +++ b/includes/filebackend/SwiftFileBackend.php @@ -861,7 +861,7 @@ class SwiftFileBackend extends FileBackendStore { if ( !empty( $params['topOnly'] ) ) { $status = $this->objectListing( $fullCont, 'names', $limit, $after, $prefix, '/' ); if ( !$status->isOk() ) { - return $dirs; // error + throw new FileBackendError( "Iterator page I/O error: {$status->getMessage()}" ); } $objects = $status->value; foreach ( $objects as $object ) { // files and directories @@ -880,7 +880,7 @@ class SwiftFileBackend extends FileBackendStore { $status = $this->objectListing( $fullCont, 'names', $limit, $after, $prefix ); if ( !$status->isOk() ) { - return $dirs; // error + throw new FileBackendError( "Iterator page I/O error: {$status->getMessage()}" ); } $objects = $status->value; @@ -956,7 +956,7 @@ class SwiftFileBackend extends FileBackendStore { // Reformat this list into a list of (name, stat array or null) entries if ( !$status->isOk() ) { - return $files; // error + throw new FileBackendError( "Iterator page I/O error: {$status->getMessage()}" ); } $objects = $status->value; -- 2.20.1